The Accordion Pane Component > FAccordionPane.setSelectedIndex() |
FAccordionPane.setSelectedIndex()
Availability
Flash Player 6.
Usage
myAccordion_acp.setSelectedIndex (index)
Parameters
index A number specifying the index of the section that should
be selected / opened within the component.
Returns
Nothing
Description
Specifies the index of the section that should be selected / opened within the component. If the specified index does not exist, the method call will be ignored.
Example
The accordion_example1.fla example file contains an example of using this method.
The following code adds four sections to the component, and sets the selected index to the third item.
var sections = ["Section 1","Section 2","Section 3","Section 4"];
myAccordionPane_acp.setDataProvider(sections);
myAccordionpane.setSelectedIndex(2);
var index = myAccordionPane_acp.getSelectedIndex();
trace("Index: "+index); //traces "Index: 2"
See also
FAccordionPane.getSelectedIndex()